package com.sprite.support.wechat.eventhandler;

import com.sprite.support.wechat.bean.req.ReqEventMessageBean;
import com.sprite.support.wechat.bean.resp.RespBaseMessageBean;

public abstract class DefaultScanEventHandler extends ScanEventHandler{

	@Override
	public RespBaseMessageBean handle(ReqEventMessageBean bean) {
		String eventKey = bean.getEventKey();
		boolean hasAttention = eventKey.startsWith("qrscene_");
		String param = eventKey;
		if(hasAttention) {
			param = eventKey.substring(8);
		}
		return handle(!hasAttention, param, bean);
	}
	
	public abstract RespBaseMessageBean handle(boolean hasAttention, String secen, ReqEventMessageBean bean);

}
